﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using RM.Common;
namespace RM.BLL
{
    public partial class RMLog
    {
        private readonly DAL.RMLog dal;
        public RMLog()
        {
            dal = new DAL.RMLog();
        }
        public int GetCount(string strWhere)
        {
            return dal.GetCount(strWhere);
        }
        public Model.RMLog GetModel(int id)
        {
            return dal.GetModel(id);
        }
        public DataSet GetList(int Top, string strWhere, string filedOrder)
        {
            return dal.GetList(Top, strWhere, filedOrder);
        }
        public DataSet GetList(int pageSize, int pageIndex, string strWhere, string filedOrder, out int recordCount)
        {
            return dal.GetList(pageSize, pageIndex, strWhere, filedOrder, out recordCount);
        }
        public int Add(Model.RMLog model)
        {
            return dal.Add(model);
        }
        public int Add(DateTime datetime, string logger, string message)
        {
            Model.RMLog model = new Model.RMLog();
            model.Datetime = datetime;
            model.Thread = "";
            model.LogLevel = "";
            model.Logger = logger;
            model.Message = message;
            model.Address = DTRequest.GetIP();
            return dal.Add(model);
        }
    }
}
